<extend name="Layout:layout_content" />
<block name="body_main">
    <div class="xsui-form-hd">
        <h1>网站设置</h1>
    </div>
    <div class="xsui-page-header">
        <ul class="xsui-tabs">
            <li class="ui-state-active"><i class="fa fa-gears"></i><a href="#B">基本设置</a></li>
            <!--<li class="ui-state-default"><i class="fa fa-folder"></i><a href="#C">内容设置</a></li>-->
            <li class="ui-state-default"><i class="fa fa-users"></i><a href="#U">用户设置</a></li>
            <li class="ui-state-default"><i class="fa fa-dashboard"></i><a href="#S">系统设置</a></li>
        </ul>
    </div>
    <form action="{:U('site_setting_save')}" method="post" class="xsui-form xsui-form-vertical">
        <fieldset>
            <div class="xsui-form-field xsui-hidden" data-group="B">
                <label>网站标题：</label>
                <input type="text" name="site_title" placeholder="网站标题" value="{$data.site_title}" size="60" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="B1">
                <label>网站代号：<span>（只能是英文或英文+数字组合,如：XWAMP）</span></label>
                <input type="text" name="site_code" placeholder="网站代号(建议填写公司名称中每个汉字的拼音首字母,如：XWAMP)" title="只能是英文或英文+数字组合,建议填写公司名称中每个汉字的拼音首字母,如：XWAMP" value="{$data.site_code}" size="60" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="B">
                <label>站点状态：<span>（站点关闭后其他用户不能访问，管理员可以正常访问）</span></label>
                <sohtml:select name="site_status" items="Y:关停;N:运营" value="{$data.site_status|default='N'}" required="required" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="B">
                <label>站点关闭公告：<span>（站点关闭后，页面的提示消息）</span></label>
                <textarea name="site_closed_announcement" placeholder="站点关闭公告" cols="60" rows="3">{$data.site_closed_announcement|default='抱歉,网站正在维护,请您稍后访问~'}</textarea>
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="U">
                <label>系统管理员邮箱帐号：<span>（用于通过电子邮箱接收系统信息）</span></label>
                <input type="text" name="admin_email" placeholder="系统管理员邮箱帐号" value="{$data.admin_email}" size="60" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="U">
                <label>系统管理员手机号码：<span>（用于通过短信接收系统信息）</span></label>
                <input type="text" name="admin_mobile" placeholder="系统管理员手机号码" value="{$data.admin_mobile}" size="60" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="S">
                <label>列表分页记录数：</label>
                <input type="number" name="content_list_rows" placeholder="列表分页记录数" value="{$data.content_list_rows|default=30}" size="60" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="S">
                <label>来电弹屏模式：</label>
                <sohtml:select name="cti_screenpop_mode" items="D:直接弹屏;M:消息提醒;F:关闭来电弹屏" value="{$data.cti_screenpop_mode|default='M'}" required="required" />
            </div>
            <div class="xsui-form-field xsui-hidden" data-group="S">
                <label>来电弹屏同号码弹屏间隔时间：</label>
                <input type="number" name="cti_screenpop_duplicate_expire" placeholder="来电弹屏同号码弹屏间隔时间" value="{$data.cti_screenpop_duplicate_expire|default=120}" size="60" />
            </div>        
        </fieldset>
        <button type="submit" class="xsui-btn ui-state-default"><i class="fa fa-save"></i>保存</button>
        <button type="reset" class="xsui-btn ui-state-default">重置</button>
        <input type="hidden" name="id" value="{$data.id}" />
    </form>
</block>
<block name="body_after">
    <script>
        $(function () {
            $('.xsui-tabs a').click(function () {
                toggle_fields($(this).attr('href').substring(1));
                $('.xsui-tabs li').removeClass('ui-state-active').addClass('ui-state-default');
                $(this).parent().removeClass('ui-state-default').addClass('ui-state-active');
            })
            toggle_fields('B');
        })
        // 切换字段 2015-11-7 SoChishun Added.
        function toggle_fields(group) {
            $('.xsui-form-field').hide();
            $('.xsui-form-field[data-group="' + group + '"]').show();
        }
    </script>
</block>